﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using DB;
namespace Control
{
    public class ShowController
    {
        DbMovie dbMovie;
        IDbShow dbShow;
        IDbCinemaHall dbCh;
        
        public ShowController()
        {
            dbShow = new DbShow();
            dbMovie = new DbMovie();
            dbCh = new DbCinemaHall();
        }
        public List<Show> GetAllShowsThisDate(DateTime dateTime, bool retriveAssociation)
        {
            return null;
        }

        public Show FindShow(DateTime dateTimeStart, string cName, bool retriveAssociation)
        {
            return null;
        }


        public Show FindShowWithId(int id, bool retriveAssociation)
        {
            return null;
        }
        public void DeleteShow(DateTime startTime, string cName)
        {
            dbShow.DeleteShow(startTime, cName);

        }
        public void CreateShow(string serialNo,string cName, string dateStart,string dateEnd, string pricePerTicket)
        {
            Movie newMovie = dbMovie.FindMovie(serialNo);
            CinemaHall ch = dbCh.FindCinemaHallNew(cName,false);
            double newdouble = Convert.ToDouble(pricePerTicket);
            Show newShow = new Show(newMovie,ch,DateTime.Parse(dateStart),DateTime.Parse(dateEnd),newdouble);
            Console.WriteLine("jalla: " + newdouble);
            Console.WriteLine("jalla2: " + newShow.PricePerTicket);
            dbShow.InsertShow(newShow,serialNo,cName);

        }
        public List<Show> FindAllShows(bool retrieveAssociation)
        {
            return dbShow.FindAllShows(retrieveAssociation);
        }
    }
}
